package com.tuanda.app.customviewdemo.paint;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.support.annotation.Nullable;
import android.util.AttributeSet;

import com.tuanda.app.customviewdemo.BaseCustomView;

/**
 * Created by LiDongduo on 2018/9/21.
 */
public class PaintShadowLayerView extends BaseCustomView {
    public PaintShadowLayerView(Context context) {
        super(context);
    }

    public PaintShadowLayerView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public PaintShadowLayerView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void initData() {
        mPaint.setTextSize(20);
        mPaint.setColor(Color.BLACK);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        mPaint.setShadowLayer(20,0,0,Color.BLUE);
        canvas.drawText("测试文本",0,50,mPaint);
    }
}
